<include file="__PUBLIC__/_header" />
<link rel="stylesheet" href="__APP_SKIN__css/orderManage.css">
<link rel="stylesheet" href="__APP_SKIN__css/newInformation.css?1">
<script src="__APP_SKIN__js/orderManage.js" type="text/javascript"></script>
<script src="__APP_SKIN__js/orderList.js?21" type="text/javascript"></script>
<script src="__APP_SKIN__js/FileSaver.js" type="text/javascript"></script>
<script src="__APP_SKIN__js/plugin/WdatePicker.js" type="text/javascript"></script>
<body>
<!--头部开始-->
<include file="__PUBLIC__/_nav" />
<!--头部结束-->
<div class="Infobox" style="clear: both;">

    <if condition="$data ">
        <div class="searchInfo searchifo3">
			<!--
            <div class="searchInfo-box" >
            开始日期:
            <input id="d11" type="text" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
            结束日期:
            <input id="d12" type="text" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
            <a class="orderso" href="javascript:void(0)">查询</a>
                </div>
			-->
        </div>
        <table  style="margin-top: 20px;" cellspacing="0" cellpadding="0" class="table22" border="0">
            <thead>
            <tr>
                <th class="th221">订单时间</th>
                <th class="th222">订单编号</th>
                <th class="th223">订单总金额</th>
                <th class="th226">整单备注</th>
                <th class="th227">订单状态</th>
                <th class="th228">操作</th>
            </tr>
            </thead>
            <tbody id="tbody">


            <volist name="data" id="vo">
                <tr id="tr_{$vo.sheet_no}">
                    <td height="43">{$vo.order_dt}</td>
                    <td><a href="{:Controller::_createUrl('index/orderdetail')}/orderid/{$vo.sheet_no}">{$vo.sheet_no}</a></td>
                    <td style="text-align: right;">￥{$vo.sheet_amt}</td>    
                    <td class="th226">{$vo.memo}</td>
                    <td>
                    <span style="color:red">
                          <if condition="$vo.approve_flag eq 1 ">
                              <font color=blue>已审核</font>
                              <else/>
                              未审核
                          </if>
                    </span>
                    </td>
                    <td>
                        <dl class="dl1">
                            <dt class="dt3"><a href="{:Controller::_createUrl('index/orderdetail')}/orderid/{$vo.sheet_no}" class="a1">订单详情</a></dt>
                            
                            <!--<dt class="dt2"><a href="javascript:void(0)"  class="hdel" data-order="{$vo.sheet_no}">删除订单</a></dt>-->
                         
                            <dt class="dt1"><a href="javascript:void(0)" onclick="addCartFromOrder('{$vo.sheet_no}')">再次购买</a></dt>
                        </dl>
                    </td>
                </tr>
            </volist>


            </tbody>
        </table>

        <div class="page">
            <div>{$pager_html}</div>
        </div>
        <else/>
        <div class="searchInfo searchifo3">  <div style="width:600px;text-align:center;margin: 30px auto;">暂无数据</div></div>
    </if>
</div>

    <div class="footer">
        <!--<p>湘ICP备13004873号-3 Copyright  芙蓉兴盛 2001-2016，All Rights Reserved </p>-->
       <!-- <p>监督热线：400-600-2200 企业QQ：400-6611-001</p>-->
    </div>


</body>
<script>

function addCartFromOrder(order_id) {
    //透明遮罩层
    layer.load(0);
    //加入购物车
    $.ajax({
        url: configs.s_url+"pcorder/index/addCartOrder",
        type: "post",
        data: { "order_id": order_id},
        success: function (json) {
            var data = $.parseJSON(json);
            layer.closeAll();
            if (data.code == "200") {
                layer.msg('成功加入购物车', { time: 1000 });
                $("#cartCount").html(data.total);
                clearCartCookie();
                selectCart();
            } else {
                layer.alert(data.msg);
            }
        }
    });
}

    $(function(){

        $(".hdel").click(function(){

           var id= $(this).attr("data-order");

            //询问框
            layer.confirm('确定关闭？关闭后该订单将不显示在订单列表。', {
                btn: ['确定', '取消'] //按钮
            }, function () {
                layer.closeAll();
                //加载层
                layer.load(0, { shade: [0.3, '#000'] });
                orderdelHttpHelper.deleteOrd(id);

            }, function () {
                layer.closeAll();
            });

        })
      $(".orderso").click(function(){
          var starttime=  $("#d11").val();
          var endtime=  $("#d12").val();
              if(!starttime){
                  layer.tips('请选择开始时间', '#d11', {
                      tips: 3
                  });
                  return;
              }
if(!endtime){
    var href="{:Controller::_createUrl('index/orders')}/ordtime/"+starttime;
}else{
    var href="{:Controller::_createUrl('index/orders')}/ordtime/"+starttime+'/ordtime_end/'+endtime;
}

          window.location.href=href;

      })

        $(".maintop .left .meun a").eq(2).addClass("active");
    })
</script>
</html>